<template>
  <el-dialog custom-class="error_message" width="40%" :title="title" :model-value="!!errorMessage" :show-close="false">
    <div v-text="errorMessage"></div>
    <div slot="footer">
      <el-button type="primary" @click="errorOk" size="small">OK</el-button>
    </div>
  </el-dialog>
</template>

<script>
import elementButton from "../plugins/element/button.js";

const component = {
  name: "error_alert",
  props: {
    errorMessage: String,
    title: {
      type: String,
      required: false,
      default: "出错提示"
    }
  },
  methods: {
    errorOk() {
      this.$emit("ok");
    }
  },
  emits: ["ok"]
};

elementButton(component);

export default component;
</script>
